package process_demo.review.other_locks.reentrantLock;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author haomin
 * @date 2022/09/20 17:39
 **/
public class Main {
    public static void main(String[] args) {
        // 同一个线程申请同一把锁
        Lock lock = new ReentrantLock();
        lock.lock(); // main 线程锁
        lock.lock(); // 如果能申请同一把锁，就能执行下面的代码
        System.out.println("可执行之后的代码");
    }
}